Skip to content

containerized-app-and-db#7

Open
hamdanshaa wants to merge 2 commits intoCodelineAtyab:mainfrom
hamdanshaa:hamdanshaaili-containerize-app
Open

containerized-app-and-db#7
hamdanshaa wants to merge 2 commits intoCodelineAtyab:mainfrom
hamdanshaa:hamdanshaaili-containerize-app

Conversation

@hamdanshaa
Copy link

I have containerized the Spring Boot MVC application along with a MySQL database using Docker and Docker Compose. The Dockerfile builds the Spring Boot application, and the docker-compose.yml file orchestrates the application and database containers.
I have gone with using Maven and OpenJDK 17 from Docker itself instead of installing them.

Copy link
Owner

@CodelineAtyab CodelineAtyab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please respond to comments

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is an IDE related config file, It should not be pushed because every user might have their own config file, and if they pull the changes, this file will conflict with theirs.

environment: # Set environment variables for the Spring Boot application
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3307/usersystem?useSSL=false&serverTimezone=UTC&createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true # JDBC URL for the MySQL database
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: root
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should never push the password on GitHub.
Using the .env file can help solve this issues.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Target directory is machine specific and should not be pushed with the project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants